package com.example.linearlayoutdemo;

import androidx.lifecycle.ViewModel;

public class UserViewModel extends ViewModel {
    // 1. 邮箱不再写死，初始值为空（后续由 MainActivity 传进来）
    private String userEmail;
    private String userInterest = "未选择"; // 兴趣初始值还是“未选择”

    // 2. 给邮箱加 Set 方法：让 MainActivity 能设置登录传的邮箱
    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    // 3. Get 方法不变：供 Fragment 获取邮箱和兴趣
    public String getUserEmail() {
        return userEmail;
    }

    public String getUserInterest() {
        return userInterest;
    }

    public void setUserInterest(String userInterest) {
        this.userInterest = userInterest;
    }
}